import { createRouter, createWebHashHistory } from "vue-router"
import Layout from "@/Layout/index.vue"
import { getId } from "@/utils/index"

import NotFound from "@/views/Error/404.vue"
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      name: "Layout",
      component: Layout,
      meta: {
        icon: "homepage",
        id: getId(),
        title: "首页",
        hidden: true
      },
      children: [
        {
          path: "",
          name: "Home",
          component: () => import("@/views/System/Home/index.vue"),
          meta: {
            icon: "homepage",
            title: "首页",
            id: getId()
          }
        }
      ]
    },
    {
      path: "/menu",
      component: Layout,
      meta: {
        icon: "menu",
        title: "菜单",
        id: getId(),
        hidden: true
      },
      children: [
        {
          path: "1",
          component: () => import("@/views/System/Menu/index.vue"),
          meta: {
            icon: "ranking",
            title: "菜单1",
            id: getId(),
            hidden: true
          }
        },
        {
          path: "2",

          component: () => import("@/views/System/Menu/index.vue"),
          meta: {
            icon: "ranking",
            title: "菜单2",
            id: getId(),
            hidden: true
          },
          children: [
            {
              path: "1",

              component: () => import("@/views/System/Menu/index.vue"),
              meta: {
                icon: "ranking",
                title: "菜单2-1",
                id: getId(),
                hidden: true
              },
              children: [
                {
                  path: "1",

                  component: () => import("@/views/System/Menu/index.vue"),
                  meta: {
                    icon: "ranking",
                    title: "菜单2-1-1",
                    id: getId(),
                    hidden: true
                  }
                },
                {
                  path: "2",

                  component: () => import("@/views/System/Menu/index.vue"),
                  meta: {
                    icon: "ranking",
                    title: "菜单2-1-2",
                    id: getId(),
                    hidden: true
                  }
                },
                {
                  path: "3",

                  component: () => import("@/views/System/Menu/index.vue"),
                  meta: {
                    icon: "ranking",
                    title: "菜单2-1-3",
                    id: getId(),
                    hidden: true
                  }
                },
                {
                  path: "4",

                  component: () => import("@/views/System/Menu/index.vue"),
                  meta: {
                    icon: "ranking",
                    title: "菜单2-1-4",
                    id: getId(),
                    hidden: true
                  }
                }
              ]
            },
            {
              path: "2",

              component: () => import("@/views/System/Menu/index.vue"),
              meta: {
                icon: "ranking",
                title: "菜单2-2",
                id: getId(),
                hidden: true
              }
            },
            {
              path: "3",

              component: () => import("@/views/System/Menu/index.vue"),
              meta: {
                icon: "ranking",
                title: "菜单2-3",
                id: getId(),
                hidden: true
              }
            },
            {
              path: "4",

              component: () => import("@/views/System/Menu/index.vue"),
              meta: {
                icon: "ranking",
                title: "菜单2-4",
                id: getId(),
                hidden: true
              }
            }
          ]
        },
        {
          path: "3",

          component: () => import("@/views/System/Menu/index.vue"),
          meta: {
            icon: "ranking",
            title: "菜单3",
            id: getId(),
            hidden: true
          }
        },
        {
          path: "4",

          component: () => import("@/views/System/Menu/index.vue"),
          meta: {
            icon: "ranking",
            title: "菜单4",
            id: getId(),
            hidden: true
          }
        },
        {
          path: "5",

          component: () => import("@/views/System/Menu/index.vue"),
          meta: {
            icon: "ranking",
            title: "菜单5",
            id: getId(),
            hidden: true
          }
        }
      ]
    },
    {
      path: "/component",
      name: "Component",
      meta: {
        icon: "all-application",
        id: getId(),
        hidden: true,
        title: "组件"
      },
      component: Layout,
      children: [
        {
          path: "",
          meta: {
            icon: "all-application",
            id: getId(),
            hidden: false,
            title: "组件"
          },
          component: () => import("@/views/System/Component/index.vue")
        },
        {
          path: "svg-icon",
          name: "SvgIcon",
          meta: {
            id: getId(),
            hidden: false,
            title: "SvgIcon",
            icon: "svg"
          },
          component: () => import("@/views/System/Component/SvgIcon/index.vue")
        },
        {
          path: "map",
          name: "Map",
          meta: {
            id: getId(),
            hidden: false,
            title: "地图",
            icon: "map"
          },
          component: () => import("@/views/System/Component/Map/index.vue")
        }
      ]
    },
    {
      path: "/vue",
      name: "Vue",
      meta: {
        icon: "all-application",
        id: getId(),
        hidden: true,
        title: "Vue"
      },
      component: Layout,
      children: [
        {
          path: "",
          name: "vue",
          component: () => import("@/views/System/Vue/index.vue"),
          meta: {
            icon: "homepage",
            title: "基础",
            id: getId()
          }
        },{
          path:"component",
          name:'component',
          meta:{
            icon: "homepage",
            title: "组件",
            id: getId()
          },
          component:()=>import("@/views/System/Vue/Component/index.vue")
        }
      ]
    },
    {
      path: "/login",
      name: "Login",
      meta: {
        icon: "login",
        title: "登录",
        hidden: true
      },
      component: () => import("@/views/System/Login/index.vue")
    },

    {
      path: "/:pathMatch(.*)*",
      name: "NotFound",
      meta: {
        icon: "4041",
        title: "404",
        hidden: true
      },
      component: NotFound
    }
  ]
})

export default router
